window.chap=window.chap||{},chap.wc={},function(i){"use strict";chap.wc.attach_product_images_viewer=function(){i(".woocommerce-product-gallery__wrapper").each(function(){chap.viewer.attach(i(this))})},chap.wc.quantity_buttons=function(){i(".ui.quantity.input").length&&(i(document).on("click",".increment_quantity",function(){var t=i(this).parent().find("input"),c=(parseInt(t.val())||0)+1;return t.val(c).trigger("change"),!1}),i(document).on("click",".decrement_quantity",function(){var t=i(this).parent().find("input"),c=(parseInt(t.val())||0)-1;return t.val(0 .item"),t=t.find("option:not(:first)"),o="",t.each(function(){var t=i(this).attr("value"),c=i(this).html(),a="item";i(this).prop("selected")&&(a+=" active selected"),o=o+'
'+c+"
"}),i(this).find(".menu").html(o))})}))},chap.wc.layered_nav=function(){var c;i(".chap_layered_nav").length&&(c=["red","orange","yellow","olive","green","teal","blue","violet","purple","pink","brown","grey","black"],i(".chap_layered_nav .item").each(function(){var t=i(this).clone();t.find(".count").remove();t=t.text().toLowerCase();-1!==c.indexOf(t)&&i(this).find(".label").addClass(t)}))},chap.wc.added_to_cart=function(){i(document.body).on("wc_cart_button_updated",function(t,c){var a=i(c),c=a.next(".added_to_cart");a.hasClass("bottom")?(c.addClass("ui bottom attached secondary button"),a.removeClass("bottom")):c.addClass("ui secondary button")}),i(document.body).on("added_to_cart",function(){var t,c=".chap-cart-item-count",a=i(c);a.length&&(t=parseInt(a.html()),t++,a.html(t),0